package com.traffic.api.controller;

import com.traffic.api.util.RandomUtil;
import org.apache.commons.lang3.RandomUtils;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Random;

/**
 * Created by churcy on 2017/6/11.
 */
public class Test {

    public static void main(String[] args) throws IOException {
        /// /INSERT INTO device (`device_id`, `price`, `gprs_code`, `head_show`, `carry_type`, `carry_no`, `carry_code`, `carry_name`, `line_name`, `line_short`, `create_time`, `update_time`) VALUES ('C712441003434D9C9520C6D2122C8A37', 100, '8986031647200188300H', '绍兴公交', 1, '浙D12632', '浙D12632', '梅山枢纽站→大禹陵', '2', '2016-12-18 23:12:11', '2016-12-18 23:12:11');


      /*  for (int i = 0; i < 49998; i++) {
            String userId = "TEST_UID" + RandomUtil.uuid();
            String certNo = "TEST_CERT_NO" + RandomUtil.uuid();
            String sql = "INSERT " + "INTO " + "alipay_user " + "(" + "`user_id`" + "," + "`cert_no`" + ") " + "VALUES " + "(" + "\'" + userId + "\'" + "," + "\'" + certNo + "\'" + ")" + ";" + "\r\n";
            writeToFile(sql, "/Users/churcy/Downloads/testData.sql");
            writeToFile(userId + "\r\n", "/Users/churcy/Downloads/testUid.sql");
        }

        System.out.println("执行结束");*/
        for (int i = 0; i <20 ; i++) {
            Random random = new Random();
            random.nextInt(5);
            System.out.println(random.nextInt(5));

        }

    }

    public static void writeToFile(String data, String filePath) throws IOException {
        FileWriter fileWritter = new FileWriter(filePath, true);
        BufferedWriter bufferWritter = new BufferedWriter(fileWritter);
        bufferWritter.write(data);
        bufferWritter.close();
    }
}
